Here follows a list of operators that applies to mappings: In this list a and b is used to represent a mapping expression:
a + b | summation ( ([1:1]) + ([2:2,2:2]) returns ([1:1,2:2,2:2]) ) |
a - b | subtraction, returns a copy of a with all pairs whos index is present in b removed. |
a & b | intersection, return a mapping with all indices that are resent in both a and b, if an index is present in both a & b the data for that index will be taken from b. |
a | b | union, return a mapping with all values that are present in a or b, differs from summation in that values that are present in both a and b are only returned once, as with intersection, data will be taken from b when possible. |
a ^ b | xor, return a mapping with all indices that are present in a or b but not in both. |
a == b | returns 1 if a is the same mapping as b, same size, indices and values is not enough, 0 otherwise. |
a != b | returns 0 if a is the same mapping as b, same size, indices and values is not enough, 1 otherwise. |
! a | boolean not, returns 0 |
a[c] | indexing, returns the value associated with the value c in the mapping a. If there is no index c in the mapping zero will be returned. (With zero_type = 1) |
a[c]=d | setting, this associates d with c in the mapping, the index c will be added to the mapping automatically if it isn't already there. |